package net.turkishpt;

import java.util.ArrayList;

/**
 * Verbose tests for <code>LetterSequenceFilter</code> class.  
 * @author alp
 * @see LetterSequenceFilter
 */
public class LetterSequenceFilterTest {
//	public static void main(String[] args) {
//		int[] keys = {2,8,7,7,2,1,3,2};
//		
//		ArrayList<String> words = PredictionEngine.getFilteredCombinations(PhoneKey.intToPhoneKeys(keys), 9);
//		
//		System.out.println("Total words (filtered):"+words.size());
//		System.out.println("Not filtered: "+PredictionEngine.getNumberOfCombinations(PhoneKey.intToPhoneKeys(keys)));
//		
//		long s = System.nanoTime();
//		int valid = 0;
//		for(String word : words){
//			if (DictionaryValidator.validate(word.toUpperCase(LetterSequenceFilter.TURKISH))) {
//				valid++;
//				System.out.println(word);
//			}
//		}
//		
//		System.out.println("Time:"+ (System.nanoTime()-s)*1e-9+" s.");
//		System.out.println("valid: "+ valid);
//	}
	
	private static int getFilter(ArrayList<String> words, int code){
		int passed = 0;
		for(String word : words){
			if(code==1) if(LetterSequenceFilter.filter1(word)) passed++; 
			if(code==2) if(LetterSequenceFilter.filter2(word)) passed++; 
			if(code==3) if(LetterSequenceFilter.filter3(word)) passed++; 
			if(code==4) if(LetterSequenceFilter.filter4(word)) passed++; 
			if(code==5) if(LetterSequenceFilter.filter5(word)) passed++; 
			if(code==6) if(LetterSequenceFilter.filter6(word)) passed++;
			if(code==7) if(LetterSequenceFilter.filter7(word)) passed++;
			if(code==8) if(LetterSequenceFilter.filter8(word)) passed++;
			if(code==9) if(LetterSequenceFilter.filter9(word)) passed++;
		}
		return passed;
	}
}
